FROM golang:1.17 AS builder
WORKDIR /app
COPY . .


ENV GO111MODULE="on"
ENV GOPROXY="https://goproxy.cn,https://gocenter.io,direct"
#ENV GOPRIVATE="github.com/gstones/platform"
#ENV GONOSUMDB="github.com/gstones/platform"
ENV GOPRIVATE="github.com/donglei1234/platform"
ENV GONOSUMDB="github.com/donglei1234/platform"

RUN echo "-----start RUN ./build.sh..."

RUN ./build.sh

RUN echo "-------end RUN ./build.sh..."


FROM ubuntu:latest
WORKDIR /app

RUN echo "-------WORKDIR /app..."


COPY --from=builder /app/teamgramd/ /app/

RUN echo "------COPY --from=builder /app/teamgramd/ /app/..."


RUN apt update -y && apt install -y ffmpeg && chmod +x /app/docker/entrypoint.sh

RUN echo "-----RUN apt update -y && apt install -y ffmpeg && chmod +x /app/docker/entrypoint.sh..."


ENTRYPOINT /app/docker/entrypoint.sh

RUN echo "----ENTRYPOINT /app/docker/entrypoint.sh..."
